package org.component 
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	/**
	 * ...
	 * @author Terry
	 */
	public class RadioButton extends Button 
	{
		
		public function RadioButton(ui:MovieClip = null) 
		{
			super(ui);
		}
		
		
		override protected function initialization():void 
		{
			super.initialization();
			
			select = false;
		}
		
		override protected function onAssestDown(event:MouseEvent):void 
		{
			select = !select;
			
			dispatchEvent(event);
		}
		
		override protected function onAssestOver(event:MouseEvent):void 
		{
			if (select) return;
			
			assest.gotoAndStop("over");
		}
		override protected function onAssestOut(event:MouseEvent):void 
		{
			if (select) return;
			
			assest.gotoAndStop("out");
		}
		
		
		private var _select:Boolean = false;
		public function get select():Boolean { return _select; }
		public function set select(value:Boolean):void
		{
			_select = value;
			
			if (value)
			{
				assest.gotoAndStop("select");
			}else
			{
				assest.gotoAndStop("out");
			}
		}
		
		
	}

}